import BaseStatus from './BaseStatus'

class ResponseData {

    static success(data,msg='success'){
        const response = {
            code: BaseStatus.SUCCESS,
            msg,
        }
        if(data){
            response.data = data;
        }
        return response
    }

    static error(msg='error',code=BaseStatus.ERROR){
        const response = {
            code,
            msg,
        }
        return response
    }
    
}

export default ResponseData;